﻿<local:ConfirmDialog x:Class="OfficeIntegration.ColumnMapper"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:framework="clr-namespace:Microsoft.LightSwitch.Runtime.Shell.Framework;assembly=Microsoft.LightSwitch.Client"
           xmlns:local="clr-namespace:OfficeIntegration"
           x:ClassModifier="Public"
           MinWidth="300" Height="Auto"
           Title="Map Columns"
           OkButtonTitle="Continue">
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <TextBlock Name="OfficeColumn" Grid.Column="0" Grid.Row="0">Office Column</TextBlock>
        <TextBlock Name="LightSwitchColumn" Grid.Column="1" Grid.Row="0">LightSwitch Column</TextBlock>
        <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.ColumnSpan="2" >
            <ItemsControl ItemsSource="{Binding}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <TextBox Text="{Binding OfficeColumn}" Grid.Column="0" IsReadOnly="True" Margin="1"/>
                            <ComboBox ItemsSource="{Binding TableFields}" SelectedItem="{Binding TableField, Mode=TwoWay}" DisplayMemberPath="DisplayName" Grid.Column="1"/>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</local:ConfirmDialog>